package com.itheima.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateDemo2 {
    public static void main(String[] args) throws ParseException {
        String birthday = "1992-10-26";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = sdf.parse(birthday);
        System.out.println(date);
        long bt = date.getTime();
        Date now = new Date();
        System.out.println(now);
        long nowTime = now.getTime();
        long day = (nowTime - bt) / 1000 / 3600 / 24;
        System.out.println(day);
    }
}
